package ru.testspring.beans;

import java.util.List;
import java.util.Map;


public class Document {

	private static int index;
	
	private String name;
	
	private int	id;
	
	private Resolution resolution00;
	
	private Correspondent correspondent00;
	
	private List<String> recievers;
	
	private Map<String, String> mapa;
	
	private Object nothing;

	public Document() {
		id = index++;
	}
	
	public Document(Resolution resolution00) {
		this.resolution00 = resolution00;
	}

	public Document(Correspondent correspondent00) {
		this.correspondent00 = correspondent00;
	}

	public Document(String name) {
		id = index++;
		this.name = name;
	}	

	public void setId(int id) {
		this.id = id;
	}

	public void setResolution00(Resolution resolution00) {
		this.resolution00 = resolution00;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Correspondent getCorrespondent00() {
		return correspondent00;
	}

	public void setCorrespondent00(Correspondent correspondent00) {
		this.correspondent00 = correspondent00;
	}

	public List<String> getRecievers() {
		return recievers;
	}

	public void setRecievers(List<String> recievers) {
		this.recievers = recievers;
	}

	public Map<String, String> getMapa() {
		return mapa;
	}

	public void setMapa(Map<String, String> mapa) {
		this.mapa = mapa;
	}

	public Object getNothing() {
		return nothing;
	}

	public void setNothing(Object nothing) {
		this.nothing = nothing;
	}

	public String process() {
		String str = "Processing " + name + "... " + id + " and " + (hasResolution() ? "has resolution." : "has no resolution.");
		StringBuilder sb = new StringBuilder(str);
		sb.append(" With correspondend: " + correspondent00.getId());
//		sb.append(" With receiver or mapa: " + getMapa().get("oneKey"));
//		sb.append(" and " + getMapa().get("twoKey"));
		sb.append(" Plus nothing: " + getNothing());
		return sb.toString();
	} 
	
	public boolean hasResolution() {
		return resolution00 != null;
	}

}
